<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <!--Bootstrap布局框架-->
    <link rel="stylesheet" type="text/css" href="css/selectcourse/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="css/selectcourse/zftal-ui.css" />
	<script src="js/selectcourse/vue.min.js"></script>
    <script src="js/selectcourse/vue-resource.min.js"></script>
</head>
<body> 
<header class="navbar-inverse top2">
	<div class="container">
		<a id="topButton" class="navbar-brand">信息维护 </a>
	</div>
</header>

<div class="container container-func sl_all_bg" id="coursetablearea" style="min-height: 1597px;">
	<div class="container">
		<div class="row clearfix">
			<div class="col-md-6 column">
				<form role="form"  id="datatable">
					<div class="form-group">
						<label for="pass1">输入新密码</label><input type="password" v-model="password1" class="form-control" id="pass1" required="required"/>
					</div>
					<div class="form-group">
						<label for="pass2">确认新密码</label><input type="password" v-model="other1" class="form-control" id="pass2" required="required"/>
					</div>
					<button type="button" class="btn btn-default" @click="changePass()">提交修改</button>
				</form>
			</div>
			<div class="col-md-6 column">
			</div>
		</div>
	</div>
</div>
</body>
<script type="text/javascript">
    var vm = new Vue({
        el:"#datatable",
        data:{
            password1:"",
			other1:""
        },
        methods: {
            changePass: function () {
                if(this.password1=="")
                    alert("请输入密码");
                else if(this.password1!=this.other1){
                    alert("两次密码输入不一致！");
				}
                else {
                    this.$http.post("/changepassword", {
                            newpass: this.password1
                        },
                        {emulateJSON: true}).then(function (value) {
                            alert("修改成功！");
                        }
                        , function (reason) {
                            alert("出错了");
                        })
                }
            }
        }
    });
</script>
</html>


